package cn.tedu.baidashi.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119601891";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC+dpcPzA2I+ollFKChMHNzdkiYlsqXw2vIZSHxV3DQj2/IN3LnaPg7pVVysvmWwQf85ClTu49bAP+mGUGg3wfR2t1hyM4QI/JWvAWSlXbxbmxnsXSTkykki6rMtbXzrcI1Kj3x4BLGC69n3CjesXD0+frtwDtJqqUNL/kledJgB/JR2egktcKYAURwAdR+eFXyTsQ/f3GkwaY8cMRR9YPeIYvYfKlkC3xDNStfL4aNaWXvf9RYu63FJPp6BJHzYvs0tRUqtZv7Jq0c9+S04bHnhb0QOmSpa7ciJN3xkT6ULNnctIC3pbX1Qfd05l+4vW1YyPiGAWkAKxyDFfHz4z8dAgMBAAECggEBAJ/lWT6G1RoZEr2MSqnnzhSxyZJojV5JTjQnSw6clPZSZMqWWl2Rz0vrqkenn0eDeFxDg7pq7Je+x+C+tU0D0EHKVy6fcPc15l4QbTE5T2iyhkmrPa4izliC9Hn1VvJi/na5ptVngvtGlhRATQNfve+76YAtcNiQbQ4cJzLiCc5Zirtcps1LKOi31dWtHScT+glp48ArE56E01mbdVi1I7ZWSLLQUDn7B03UqiU9Upm7T1pgf4xkeaFCBLSwrm1gEQDopTraMLAVhqFBF/3OQV1I2ng7Eq7l0al5VgiF40ir67tZbPoBs6LCX5gFz2z2Tgt1Dt8Us0q3BLJs3aFRPzUCgYEA3y4j3DnQuYulJbFC4ndf3IcLiG8uQDGwuse+8ZkDqeBK5k+IAY89AncBC8IO46iUn1f5cDWoUhTMXYa01jQTL6R2BX1JVmSsExaApfSSgHk4wLGkPVtjVCD+q5fKKCV5zoX5TGnia+WNRa+CDjlZUUX53qR2oVWpTlLe8/nVpHcCgYEA2njInZxQ50mBWuCWQZskZjSHzG+jo7o+oq6POC3R0sqO9ppIffZ4KGUqGLWSZF9BSVmn0XaEQvgSpHKa0Anb2Mq4sDq53vrddGSwZ8M+hCOUA5mJZ6aCvN/narjA+q4AbOjeuSvJ4Sihr35yVxieQxW2Qe2fhWDb4TZOuytFwgsCgYAEy3j5wkQ5uEZUCPrm4qmskzosNDdKKcciPCheCGuLusXhLNQ/NFSbOPNMzV6EhZqr0bgKMRzspoW9fKdl8rh2zZG7jHWG5aLMxi79YcPD/ta5TRe6ObxokkzmYtx1AFkdlsNEYQH8T3I5jQu+Qn0owdgccGwcCzsX86/WjgeJAQKBgF/qqYFxEKAKyI0Cj1VsbLWmmHxsAzct3LQF2YE7tKRMJComoG8VF7n8eFfy17vTilFO2HwBAZ55VY33dvqhaXErx5wvnE1GbJXeYwibUsYm7KQL86SbGUkdMHfNd4RXgn5OWwKHNBHzidEHveF5QHqJfMRDNEcVuFOPSU+pdu3zAoGBAN38dI3TNX62xiPexNzCGEogOT/W66Y79t2FKq6Q1ZgFVUpPdtOjQHKs/Res7Uwi9kbnDUGvrRUOvM4LbnqP/1d/YbqibnneDspcdGsupgRSZon8wv1H3FZQb3vTMgFjq28uoSCQ0/T3d36JSQgwMvyymOUTax50efORsZvmwU/8";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkt2iUdzyIZ9BgyM4aU21VQ/fnbfpnVUR6BJvUYzcIItlnsMc+2rUFFPkQtqJOU2VernZSlmpUi65rLi2HtWJ7S9Sjp5cjFkmf2ppmk2SZYngW1bKVVE0aBNonX2rNpPtiDGQC/rpJRNacST8qMuyhgLmoZt1ooyyTFpL92BnFgGPKNE6dhN8IcjacrnpSsDLpWhRV0SECSLQOYqsw7uUT3hKOcMg+rUGjG9NeobtsbwbkpnCGrJGpt0XeTFIrYrtQ6Gwe0a8FHlhYlQk6PpNIzOBr1wkS4s1LrLJUwbHKrsCLukjnFfr/zuV/VUtFRNhNofvHSQr66Tqeaye5dffYwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/result.html";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/result.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    // public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志文件夹路径
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

